POV-Ray : Newsgroups : povray.programming : Where can I find the reflected ray? : Re: Where can I find the reflected ray? Server Time
28 Jul 2024 12:36:10 EDT (-0400)
  Re: Where can I find the reflected ray?  
From: Wu Yang
Date: 14 Oct 2002 13:56:07
Message: <3dab0537@news.povray.org>
Yes, I got it. Thank you very much. But I do not know why "box.pov" is
not a scene with reflection. I do see it. Why can I see it? The data for
displaying is what I want to get. Is it called light internsity?
   Actually, the code I post is the only code I wrote till now. I only want
to test if the reflect() function is called when I rend some pov file. Thank
you for your advice.

Best Regard
Wu Yang
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
> In article <3daa404f@news.povray.org>, "Wu Yang" <wya### [at] cswrightedu>
> wrote:
>
> >    Is "box.pov" a scene with reflection.
>
> No. It doesn't use reflection anywhere, which would be one reason no
> files are written. Actually looking at the scene might have helped... ;-)
> I'd suggest you use one of the demo scenes in scenes/textures/finishes/,
> all of which do use reflection. And watch out, it could produce a huge
> amount of data. I don't know what you want it for, it might be best to
> make a very simple scene with one reflective shape to minimize the
> amount of reflection data.
>
>
> > I do render it, but the reflect()
> > function is not called because I define an "ofstream" object "output" in
> > reflect() function. The exact code is "ofstream
output("C:\\out.dat");".And
> > then render "box.pov",however, no "out.dat" formed. What's wrong?
>
> > static void Reflect(......)
> > {
> >   ofstream output("D:\\out.dat");
>
> First, you are opening the file for every reflected ray. This will be
> very slow, it would be better to open it once, for a temporary hack like
> this it would be easiest to just use a global variable. Also, you are
> opening it in write mode, it will overwrite the previously written data
> every time, so you will never get a file with more than one entry. You
> need to either open it once or open it in append mode. Opening the file
> once in write mode and using a global variable for it would be the best
> way: it will be much faster, and if you use append mode you will have to
> remember to delete the data file before each render or it will just
> append to what it wrote in previous renders.
>
> And finally, you didn't give all the code. This is just the code for
> opening a file, you didn't say how you are writing the data.
>
> --
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.